//===============================================================================
// Microsoft Architecture Strategy Team
// LitwareHR - SaaS Sample Application
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System;
using System.Collections.Generic;
using System.Text;

using LitwareHR.Recruiting.Contract;
using Shp.Runtime.Contract;

namespace LitwareHR.Recruiting.Workflows
{
    public class RecruitingMoniker : IRecruitingMoniker
    {
        public event EventHandler<RecruitingProcessClosedEventArgs> RecruitingProcessClosed;

        public event EventHandler<RecruitingProcessOpenedEventArgs> RecruitingProcessOpened;

        public event EventHandler<ResumeSubmittedEventArgs> ResumeSubmitted;

        public void CloseRecruitingProcess(Guid recruitingProcessId)
        {
            RecruitingProcessClosedEventArgs args = new RecruitingProcessClosedEventArgs(recruitingProcessId);
            EventHandler<RecruitingProcessClosedEventArgs> evh = RecruitingProcessClosed;
            if (evh != null)
            {
                evh(null, args);
            }
        }

        public void OpenRecruitingProcess(Guid recruitingProcessId)
        {
            RecruitingProcessOpenedEventArgs args = new RecruitingProcessOpenedEventArgs(recruitingProcessId);
            EventHandler<RecruitingProcessOpenedEventArgs> evh = RecruitingProcessOpened;
            if (evh != null)
            {
                evh(null, args);
            }

        }

        public void SubmitResume(Guid recruitingProcessId, Resume resume, Upn upn)
        {
            ResumeSubmittedEventArgs args = new ResumeSubmittedEventArgs(recruitingProcessId, resume);
            args.Identity = upn.ToString();

            EventHandler<ResumeSubmittedEventArgs> evh = ResumeSubmitted;
            if (evh != null)
            {
                evh(null, args);
            }
        }
    }
}
